<template>
  <div class="head" v-if="oItem">
    <p :style="{ color: oItem.main.pageTopFontColor }">
      {{ oItem.main.pageTitle || "这里是页面标题" }}
    </p>
    <span
      class="back"
      v-if="oItem.main.backButton == 2"
      :style="{ color: oItem.main.pageTopFontColor }"
      ><i class="icon icon-back"></i>返回</span
    >
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "mainPageTop",
  data() {
    return {
      oItem: null,
    };
  },
  props: ["ename", "id"],
  components: {},
  created() {},
  mounted() {
    this.$nextTick(() => {
      this.init();
    });
  },
  methods: {
    init() {
      this.oItem = null;
      this.oItem = JSON.parse(JSON.stringify(this.decorate.controls[0]));
    },
    
  },
  computed: mapState(["decorate"]),
  watch: {},
};
</script>

<style scoped lang="scss">
.head {
  width: 100%;
  height: 30px;line-height: 30px;
  position: relative;
  .headIcon {
    width: 100%;
    height: auto;
    display: block;
  }
  .headRIcon {
    position: absolute;
    right: 7px;
    z-index: 2;
    width: 87px;
    height: 32px;
    bottom: 6px;
  }
  p {
    font-size: 12px;
    text-align: center;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 200px;
    margin: 0 auto;
    color: #212121;
  
  }
  .back {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    height: 45px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    i {
      font-size: 14px;
      position: relative;
      top: 1px;
    }
  }
}
</style>
